package com.cg.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.time.Instant;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.ArrayTypeHandler;

/**
 * @author cheyinbo
 * @since 2021-12-03
 */
@Data
@TableName("public.production_in_order_item")
public class ProductionInOrderItemPO {

    /**
     * 生产入库订单明细id
     */
    @TableId(value = "in_order_item_id", type = IdType.AUTO)
    private Integer inOrderItemId;

    /**
     * 入库订单id
     */
    @TableField(value = "in_order_id", jdbcType = JdbcType.INTEGER)
    private Integer inOrderId;

    /**
     * 商品id
     */
    @TableField(value = "commodity_id", jdbcType = JdbcType.INTEGER)
    private Integer commodityId;

    /**
     * 商品名称
     */
    @TableField(value = "commodity_name", jdbcType = JdbcType.VARCHAR)
    private String commodityName;

    /**
     * 商品sku id
     */
    @TableField(value = "commodity_sku_id", jdbcType = JdbcType.INTEGER)
    private Integer commoditySkuId;

    /**
     * 商品规格选项id
     */
        @TableField(value = "commodity_spec_option_id", jdbcType = JdbcType.ARRAY, typeHandler = ArrayTypeHandler.class)
    private Integer[] commoditySpecOptionId;

    /**
     * sku文字描述，规格选项文字数组
     */
        @TableField(value = "sku_text_description", jdbcType = JdbcType.ARRAY, typeHandler = ArrayTypeHandler.class)
    private String[] skuTextDescription;

    /**
     * 单位类型数量（例：kg，个）
     */
    @TableField(value = "unit_quantity", jdbcType = JdbcType.NUMERIC)
    private BigDecimal unitQuantity;

    /**
     * 单位类型（例：kg，个）
     */
    @TableField(value = "unit_type", jdbcType = JdbcType.INTEGER)
    private Integer unitType;

    /**
     * 单位类型名称
     */
    @TableField(value = "unit_type_name", jdbcType = JdbcType.VARCHAR)
    private String unitTypeName;

    /**
     * 总计类型数量（例：件）
     */
    @TableField(value = "total_quantity", jdbcType = JdbcType.NUMERIC)
    private BigDecimal totalQuantity;

    /**
     * 总计类型（例：件）
     */
    @TableField(value = "total_type", jdbcType = JdbcType.INTEGER)
    private Integer totalType;

    /**
     * 总计类型名称
     */
    @TableField(value = "total_type_name", jdbcType = JdbcType.VARCHAR)
    private String totalTypeName;

    /**
     * 单价：元 成本单价
     */
    @TableField(value = "unit_price", jdbcType = JdbcType.NUMERIC)
    private BigDecimal unitPrice;

    /**
     * 计价单位 kg、个、件
     */
    @TableField(value = "unit_price_type", jdbcType = JdbcType.INTEGER)
    private Integer unitPriceType;

    /**
     * 计价单位翻译
     */
    @TableField(value = "unit_price_type_name", jdbcType = JdbcType.VARCHAR)
    private String unitPriceTypeName;

    /**
     * 价格总计：元 成本总价
     */
    @TableField(value = "total_price", jdbcType = JdbcType.NUMERIC)
    private BigDecimal totalPrice;

    /**
     * 创建人id
     */
    @TableField(value = "create_by", jdbcType = JdbcType.INTEGER)
    private Integer createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", jdbcType = JdbcType.TIMESTAMP_WITH_TIMEZONE)
    private Instant createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", jdbcType = JdbcType.TIMESTAMP_WITH_TIMEZONE)
    private Instant updateTime;

    /**
     * 更新人id
     */
    @TableField(value = "update_by", jdbcType = JdbcType.INTEGER)
    private Integer updateBy;

    /**
     * 删除标识：1删除、99未删除，默认99
     */
    @TableField(value = "deleted", jdbcType = JdbcType.INTEGER)
    private Integer deleted;

    /**
     * 待入库数量
     */
    @TableField(value = "wait_unit_quantity", jdbcType = JdbcType.NUMERIC)
    private BigDecimal waitUnitQuantity;

    /**
     * 待入库副单位数量
     */
    @TableField(value = "wait_total_quantity", jdbcType = JdbcType.NUMERIC)
    private BigDecimal waitTotalQuantity;

    /**
     * 是否完成入库 1 是 99 否
     */
    @TableField(value = "complete_in_stock", jdbcType = JdbcType.INTEGER)
    private Integer completeInStock;

    /**
     * 库存批次id，退料需要退回到原来的批次，冗余此字段
     */
    @TableField(value = "batch_id", jdbcType = JdbcType.INTEGER)
    private Integer batchId;

    @TableField(value = "out_order_id", jdbcType = JdbcType.INTEGER)
    private Integer outOrderId;

    @TableField(value = "out_order_code", jdbcType = JdbcType.VARCHAR)
    private String outOrderCode;

    @TableField(value = "sale_total_quantity", jdbcType = JdbcType.NUMERIC)
    private BigDecimal saleTotalQuantity;

    @TableField(value = "sale_unit_quantity", jdbcType = JdbcType.NUMERIC)
    private BigDecimal saleUnitQuantity;

    @TableField(value = "sale_total_price", jdbcType = JdbcType.NUMERIC)
    private BigDecimal saleTotalPrice;

    /**
     * 1 totalType =  n conversion unitType
     */
    @TableField(value = "conversion", jdbcType = JdbcType.NUMERIC)
    private BigDecimal conversion;

    /**
     * 采购退货小单位数量
     */
    @TableField(value = "return_unit_quantity", jdbcType = JdbcType.NUMERIC)
    private BigDecimal returnUnitQuantity;

    /**
     * 采购退货大单位数量
     */
    @TableField(value = "return_total_quantity", jdbcType = JdbcType.NUMERIC)
    private BigDecimal returnTotalQuantity;


}
